#!/bin/bash

curl -d authorName=CI -d title="Publish begin" -d text="publish begin" -d redirectUrl=https://talk.ai/site https://jianliao.com/v2/services/webhook/371cb0206bd6fed28302cbf4fa85a6a708661791

# update
git fetch
git reset --hard HEAD
git pull

# tag
TAGNAME=`date +%Y%m%d%H%M%S`
git tag $TAGNAME
git push origin $TAGNAME

# prepare
dotnet restore

# publish
service supervisor stop
dotnet publish src/IdentityServer.Host
dotnet publish src/Identity.Host
dotnet publish src/Api.Host
service supervisor start
curl -d authorName=CI -d title="Publish end" -d text="publish end" -d redirectUrl=https://talk.ai/site https://jianliao.com/v2/services/webhook/371cb0206bd6fed28302cbf4fa85a6a708661791
